package examlhp.two;

import java.io.*;
import java.util.Properties;

public class main {
    public static void main(String[] args) {
        Properties prop = new Properties();
        FileInputStream fis = null;
        InputStreamReader isr = null;
        BufferedReader br = null;
        FileOutputStream fos = null;
        OutputStreamWriter osw = null;
        BufferedWriter bw = null;
        try {
            fis = new FileInputStream("D:/pro.txt");
            isr = new InputStreamReader(fis);
            br = new BufferedReader(isr);
            fos = new FileOutputStream("D:/pro2.txt");
            isr = new InputStreamReader(fis);
            br = new BufferedReader(isr);
            String name = br.readLine();
            String age = br.readLine();
            String uname = "";
            String pass = "";
            uname = name.substring(name.indexOf("：") + 1, name.length());
            pass = age.substring(age.indexOf("：") + 1, age.length());
//            System.out.println(uname);
//            System.out.println(pass);
            prop.setProperty("name", name);
            prop.setProperty("age", age);
            Student s1 = new Student();
            s1.setName(prop.getProperty("name"));
            s1.setAge(Integer.parseInt(prop.getProperty("age")));

        } catch (FileNotFoundException e) {
            throw new RuntimeException(e);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }

    }
}
